package com.eternal.base.database.dao;

import androidx.paging.DataSource;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query;

import com.eternal.base.database.entity.Student;

import java.util.List;

/**
 * Created by Administrator
 * On 2020/5/12
 * Description:
 * @author Administrator
 */
@Dao
public interface StudentDao {
    @Query("SELECT * FROM Student ORDER BY name COLLATE NOCASE ASC")
    DataSource.Factory<Integer, Student> getAllStudent();

    @Query("select * from student where name like :first")
    List<Student> getStudents(String first);

    @Insert
    void insert(List<Student> students);

    @Insert
    void insert(Student student);
}
